Executing remote script functions

The Global Collaboration Framework provides a remote command feature that can be used to run custom VBScript functions in a remote vault. This can be useful to set different property values for transferred documents than the source documents, for example.

Note    Use caution with remote commands because you cannot anticipate when they will be executed, as opposed to a remote call.

To invoke a command remotely, you add it to the GCFCommands table in the local vault, which acts as a queue for the remote vault. The GCF reads the data from this table, generates a text file, and transfers it to the remote vault for execution as described in Understanding remote commands.

To queue a command for remote execution:

  1. Add a record to the GCFCommands table from your Visual Basic or VBScript customization. The record should contain the information described in GCFCommands table.

For example, if the following function is defined in the destination vault:

Function SetValue1(v1, v2)
    Document.MyProperty = "SetValue1: " & v1 & " " & v2
End Function

Then the following statement executed in the local vault will schedule execution of the function SetValue1 in the remote vault:

Vault.Table ("GCFCommands").AddValues _
  Array ("GlobalID", "DestinationShare", "Pending", "Command", "DocName") _
  Array (Document.GlobalID, "OtherVault", True, _ "SCRIPT::SetValue1 ""String with space"" 1234", Document.Filename)

After the command executes, the property MyProperty in the remote vault is set to the following value:

SetValue1: String with space 1234